<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="com.qijia.travel.app.*"  %>
<%@ page import="com.qijia.travel.domain.*"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String detailId = request.getParameter("detailId");
TouristManager touristManager = new TouristManager();
TouristWorkDetail detail = new TouristWorkDetail();


boolean modify = false;
if(detailId!=null)modify = true;

if(modify){
try{
   int ID = Integer.parseInt(detailId);
   detail = touristManager.getWorkDetailByDetaiId(ID);
   if(detail==null){
      out.println("<script>alert('选择的旅游团不存在');</script>");
      response.sendRedirect("tourist.jsp");
   }
 }catch(NumberFormatException e){
   out.println("<script>alert('选择的旅游团不存在');</script>");
   response.sendRedirect("tourist.jsp");
 }catch(AppErrorException ex){
   out.println("<script>alert('获取数据失败!');</script>");
   response.sendRedirect("tourist.jsp");
}
}

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin:0;
	padding:10px 0;
	font-size:12px;
}
ul,li{
    list-style:none;
}
textarea{width:150px;font-size:12px;}
.ipt{width:150px;}
.ipt2{width:40px;}
.btn{border:#002d96 1px solid; padding:4px 4px 2px; font-size:12px; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA); cursor:hand; color:black;}
#wrapper{
	width:310px;
	height:160px;
	margin:0 auto;
	overflow:hidden;
}
#content{
    float:left;
	width:310px;
	height:auto;
	padding:10px 0;
}

-->
</style>
</head>

<body>
<div id="wrapper">
<c:set var="detail" value="<%=detail%>"></c:set>
    <form method="post" action="<%=basePath%>work/doUpload.jsp" enctype="multipart/form-data">
    <div id="content">
	    <ul>
	        <li><span>团编号：</span>
	          <input id="title" type="text" name="touristGroupSn" readonly="readonly" value="<%=detail.getTouristGroupSn() %>"/>
	          <input name="touristGroupId" id="touristGroupId" type="hidden" value="<%=detail.getTouristGroupId() %>"/>
	        </li>
	        <li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
	        <li><span>附件：</span><input type="file" name="touristFile" />
	        </li>
	        <li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
			<li style="padding:0 0 0 100px;"><input  name="" type="submit" class="btn" value="上传" /></li>
		</ul>
	</div>
	</form>
</div>
</body>
</html>
